<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
	label.error{color:red}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>二级分类页面</title>
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/css/common.css" />
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/css/ej_class.css" />
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/css/login.css" />
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.validate.js"></script>
<script type="text/javascript">
//validate验证
$(function(){
	$("#regist").validate({
		rules:{
			username:{
				required:true
			},
			password:{
				required:true
			},
			rePass:{
				equalTo:"#password"
			},
			/* email:{
				email:true
			}, */
			name:{
				required:true
			},
			phone:{
				required:true
			},
			mobile_code:{
				required:true
			},
			code:{
				required:true
			}
		},
		messages:{
			username:{
				required:"账户不能为空"
			},
			password:{
				required:"密码不能为空"
			},
			rePass:{
				equalTo:"密码不一致"
			},
			/* email:{
				email:"邮件格式不正确"
			}, */
			name:{
				required:"名称不能为空"
			},
			phone:{
				required:"请输入手机号码"
			},
			mobile_code:{
				required:"验证码不能为空"
			},
			code:{
				required:"请输入验证码"
			}
		}
	});
})
//验证码的切换
function check(){
	$("#checkImg").attr("src","<%=request.getContextPath()%>/checkImage?"+new Date());
}
function get_mobile_code(){
	    $.post('<%=request.getContextPath()%>/user/sms', {mobile:jQuery.trim($('#mobile').val())}, function(msg) {
	        alert(jQuery.trim(unescape(msg)));
			if(msg=='提交成功'){
				RemainTime();
			}
	    });
	};
	var iTime = 59;
	var Account;
	function RemainTime(){
		document.getElementById('zphone').disabled = true;
		var iSecond,sSecond="",sTime="";
		if (iTime >= 0){
			iSecond = parseInt(iTime%60);
			iMinute = parseInt(iTime/60)
			if (iSecond >= 0){
			if(iMinute>0){
				sSecond = iMinute + "分" + iSecond + "秒";
			}else{
				sSecond = iSecond + "秒";
			}
		}
		sTime=sSecond;
		if(iTime==0){
			clearTimeout(Account);
			sTime='获取手机验证码';
			iTime = 59;
			document.getElementById('zphone').disabled = false;
		}else{
			Account = setTimeout("RemainTime()",1000);
			iTime=iTime-1;
		}
	}else{
		sTime='没有倒计时';
	}
	document.getElementById('zphone').value = sTime;
	}
</script>
</head>
<body>
<%@include file="menu.jsp" %>

<div class="w_980 m">
  <div class="pos fl_l ma_t10"><a href="#">首页</a> > <a href="#">礼品箱包、钟表首饰</a> > <a href="#">时尚男包</a> > BOSSSUNWEN博斯绅威男士横款钱包高档礼盒S9... </div>
  <div class="w_978 fl_l ma_t10 bor">
  <div class="ej_l_title bor_t">用户注册</div>
  <div class="reg fl_l">
    <form action="<%=request.getContextPath() %>/user/doRegist" id="regist" name="regist" onsubmit="return checkForm();">
    <table width="700" border="0" cellspacing="0" cellpadding="0" class="lg_t">
      <tr>
        <td width="53%" class="te_r">用户名：</td>
        <td width="47%"><input type="text" name="username" id="username" class="inputgray" /><span id="msg"></span></td>
      
      </tr>
      <tr>
        <td class="te_r">设置密码：</td>
        <td><input type="password" name="password" id="password" class="inputgray" /><span id="msg1"></span></td>
      
      </tr>
      <tr>
        <td class="te_r">确认密码：</td>
        <td><input type="password" name="rePass" id="rePass" class="inputgray" /><span id="msg2"></span></td>
       
      </tr>    
      <!-- <tr>
        <td class="te_r">邮箱：</td>
        <td><input type="text" name="email" id="email" class="inputgray" /><span id="msg3"></span></td>
        
      </tr> -->
      <tr>
        <td class="te_r">真实姓名：</td>
        <td><input type="text" name="name" id="name" class="inputgray" /> <span id="msg4"></span></td>
      </tr>            
      <tr>
        <td class="te_r">验证码：</td>
        <td><input type="text" name="code" id="code" class="inputgray" style="width:90px;" />
        <img src="<%=request.getContextPath() %>/images/yzm.jpg" width="80" height="25" id="checkImg" onclick="check()" /><span id="msg5"></span>${err}</td>
      </tr>
      <tr>
		<td class="te_r">手机：</td><td>
		<input id="mobile" name="phone" type="text" style="width:90px;" class="inputgray" /><span style="color:#FF0000"> *</span> 
        <input id="zphone" type="button" value=" 发送手机验证码 " onclick="get_mobile_code();"/></td>
      </tr>
	  <tr>
		<td class="te_r">验证码：</td>
		<td><input type="text" size="8" name="mobile_code" class="inputgray" /></td>
	  </tr>
      <tr>
        <td>&nbsp;</td>
        <td><input type="submit" name="button" value="注册新用户" class="btn font14" /></td>
      </tr>
    </table>
    	</form>
  </div>
  </div>
  <div class="w_980 fl_l ma_t10 te_m">关于我们 | 联系我们 | 人才招聘 | 商家入驻 | 广告服务 | 移动终端 | 友情链接 | 销售联盟 <br />
    北京市公安局海淀分局备案编号：11010233381  京ICP证070的4523号 <br />
    Copyright2004-2011  五金商城 版权所有</div>
  <div class="w_980 fl_l ma_t10">
    <ul class="footerpic">
      <li><a href=" "><img src="<%=request.getContextPath() %>/images/footer_pic_04.gif" width="91" height="31" /></a></li>
      <li><a href=" "><img src="<%=request.getContextPath() %>/images/footer_pic_05.gif" width="91" height="31" /></a></li>
      <li><a href=" "><img src="<%=request.getContextPath() %>/images/footer_pic_06.gif" width="91" height="31" /></a></li>
      <li><a href=" "><img src="<%=request.getContextPath() %>/images/footer_pic_07.gif" width="91" height="31" /></a></li>
      <li><a href=" "><img src="<%=request.getContextPath() %>/images/footer_pic_09.gif" width="91" height="31" /></a></li>
      <li><a href=" "><img src="<%=request.getContextPath() %>/images/footer_cnnic.jpg" width="91" height="31" /></a></li>
    </ul>
  </div>
</div>
</body>
</html>
    